package ejb3.test;

import java.util.Properties;

import javax.naming.InitialContext;

import ejb3.HelloWorld;

public class EJBClient {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Properties props=new Properties();
		props.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
		props.setProperty("java.naming.provider.url","localhost:1099");
		try {
			InitialContext ctx=new InitialContext(props);
			HelloWorld helloworld =(HelloWorld)ctx.lookup("HelloWorldBean/remote");
			System.out.println(helloworld.sayHello("杨剑"));
			System.out.println(helloworld.getClass().getName());
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
